fix: show hydrated profile avatars in Studio header#670
fix: show hydrated profile avatars in Studio header#670edschema wants to merge 1 commit intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @edschema! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #670 +/- ##
==========================================
+ Coverage 72.97% 73.07% +0.10%
==========================================
Files 60 60
Lines 518 520 +2
Branches 108 110 +2
==========================================
+ Hits 378 380 +2
Misses 137 137
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Studio header avatar rendering currently only checks
authenticatedUser.avatar. That preserves the legacy header avatar contract, but it misses uploaded Open edX profile images because those image URLs are returned by the hydrated account payload underauthenticatedUser.profileImage.This change keeps the existing
authenticatedUser.avatarbehavior and adds a fallback to hydrated account profile image data when available:authenticatedUser.avatarauthenticatedUser.profileImage.imageUrlMediumwhenprofileImage.hasImageis trueThis does not change backend profile-image APIs, JWT contents, or fallback rendering responsibilities.
Supporting Context
The corresponding Studio app change should enable authenticated-user hydration in
frontend-app-authoring. That app-level change should be staged after this package change is released, because Studio must consume the released@edx/frontend-component-headerversion containing this normalization.Testing
npm test -- --runTestsByPath src/studio-header/StudioHeader.test.tsx --runInBand npm run typesThe targeted test suite covers:
profileImage.hasImage: falsefallbackprofileImage.hasImage: trueimage renderingauthenticatedUser.avatarpriority